const app = getApp()
import { getNewTeamDetail, setTeamAdopt, setTeamFail } from "../../api/app"
Page({
    data: {
        id:'',
        info:{}
    },
    onLoad (options) {
        console.log(options,'options')
        this.setData({
            id:options.id
        })
    },
    onReady () {

    },
    onShow () {
        this.getNewTeamDetail()
    },
    async getNewTeamDetail(){
        const result = await getNewTeamDetail({
            id:this.data.id
        })
        this.setData({
            info:result
        })
        console.log(result, 'result')
    },
    async onSetTeamAdopt(){
        app.confirm('确定通过吗').then(async () => {
            await setTeamAdopt({
                id:this.data.id
            })
            await app.toast('成功通过')
            await this.getNewTeamDetail()
        })
        
    },
    async onSetTeamFail(){
        app.confirm('确定忽略吗').then(async () => {
            await setTeamFail({
                id:this.data.id
            })
            await app.toast('忽略成功')
            await this.getNewTeamDetail()
        })
    }
})